package com.pwt.entity;

import com.pwt.annotation.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import com.pwt.entity.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;

import lombok.EqualsAndHashCode;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;


/**
 * MachineProduct
 *
 * @author auto generated
 * @date 2021-08-31 12:03:28
 */
@EqualsAndHashCode
@Data
@Entity
@Table(name = "[machine_product]")
@Schema(name = "MachineProduct")
@DynamicInsert
@DynamicUpdate
public class MachineProduct {

	@Id
	@GeneratedValue(generator="system_uuid")
	@GenericGenerator(name="system_uuid",strategy="uuid")
	@Column(name = "id")
	@Schema(description = "ID")
	@NotBlank(groups = Update.class,message = "修改时必传")
	protected String id;

	/**
	 * 机器表id，关联machine_manage.id
	 * nullable : true
	 * default  : null
	 */
	@Schema(name = "machineManageId",description = "机器表id，关联machine_manage.id")
	@Column(name = "machine_manage_id", nullable = true, length = 32)
	private String machineManageId;

	/**
	 * 产品id，关联product_manage.id
	 * nullable : true
	 * default  : null
	 */
	@Schema(name = "productManageId",description = "产品id，关联product_manage.id")
	@Column(name = "product_manage_id", nullable = true, length = 32)
	private String productManageId;
}
